Unit 4 Exercise 3
Exercise 3: Thresholds - External Events
Objective
To use an Event to increment and decrement the value of a Threshold.
Summary
Utilizing the My Threshold Schedule created in the previous exercise, you will create a new job that will execute a script called ExerciseThreshold.cmd and pass a variable of +1. You will manually add this job to the Operations View and run it. Then you will modify and rerun the job with a new value of -1.
Instructions
Create the Job
- In Library > Administration, select Master Job.
- Click Add
- In the Master Job Definition screen:
- In the Schedule drop down, select My Threshold Schedule.
- In the Name field, enter
Threshold External Event Job. - In the Job Type drop down, select Windows.
- In the Machine drop down, select SMATraining.
- In the User ID drop down, select SMATRAINING\SMAUSER.
- In the Command Line field, enter
"C:\scripts\ExerciseThreshold.cmd" +1. Remember to use properties where acceptable. - Do not forget to add Documentation.
- In the frequency section, move the
Mon-Sun-Ofrequency into the Active column.
Validate the Current Value of the Threshold
- In Library > Administration, select Thresholds.
- Select TrainingThreshold.
- Check the value. At this moment, it should be
0. - Exit Thresholds without making any changes.
Add the Job to Operations
- Open Processes to verify that My Threshold Schedule is completed.
- Right-click to My Threshold Schedule and add the Job just created to the Daily Schedule list.
- Select My Threshold Schedule and click the (+) button in the Schedule Selection side menu.
- Select Threshold External Event Job and click the Next button.
- Change the Build Status to Released.
- Click the Next button.
- Click the Submit button.
- Close the Add Jobs results screen.
- Wait until the Job finishes OK.
- In Library > Administration, select Thresholds.
- Select TrainingThreshold from the Select Threshold drop-down list.
- Check the value. At this moment, it should be
1.
note
What happened?
- The Job ran and created a file under the
MSGINfolder. - The file sent the
$THRESHOLD:SET,TrainingThreshold,+1event using theocadmOpCon account and its event token (opconxps).- OpCon received the Event and processed it. It updated the value of the Threshold:
0 + 1 = 1
- OpCon received the Event and processed it. It updated the value of the Threshold:
- Return to the Processes screen.
- Right-Click the Threshold External Event Job.
- Click the Wrench icon to open the Daily Job Definition.
- Click the Lock icon to edit Daily details.
- In Task Details, change the Command Line to this:
“C:\scripts\ExerciseThreshold.cmd” -1 - Click the Save button (This will only save the Job in the Daily Definition).
- In Processes, right-Click the Job and select Restart in the Status Update.
- Wait until the Job finishes OK.
- In Library > Administration, select Thresholds.
- Select TrainingThreshold.
- Check the value. At this moment, it should be back to
0.
note
What happened?
- The Job ran and created a file under the
MSGINfolder. - The file sent the
$THRESHOLD:SET,TrainingThreshold,-1Event using theocadmOpCon account and its Event password (opconxps).- OpCon received the Event and processed it. It updated the value of the Threshold:
1 - 1 = 0
- OpCon received the Event and processed it. It updated the value of the Threshold:
Enterprise Manager
Details
- Open Enterprise Manager.
- Under the Administration topic, Double-Click Job Master.
- Select My Threshold Schedule from the Schedule drop-down list.
- Click the Add button on the Job Master toolbar.
- Add a new Job named Threshold External Event Job.
- Setup this Job to run the script named
ExerciseThreshold.cmd, passing+1as a parameter:- The command line must be:
“C:\scripts\ExerciseThreshold.cmd” +1- The Job will run on the
SMATrainingmachine - Use the
SMATRAINING\SMAUSERUser ID - Add the
Example-Mon-Sun-OFrequency to the Job (refer to Job definition in Unit 1 for help). - Do not forget to add Documentation.
- Under Administration, Double-Click Thresholds.
- Select TrainingThreshold from the Select Threshold drop-down list.
- Check the value. At this moment, it should be
0. - Close the Thresholds tab.
- Open one of the Operations view (Matrix or List).
- Check if the My Threshold Schedule is Completed.
- If it is not Completed, Cancel all the Jobs.
- Wait until the Schedule is Completed.
- Right-Click the My Threshold Schedule> Maintenance> Add Jobs.
- Check the checkbox for the Threshold External Event Job and then click Add Job.
- Select the Released radio button and click Yes.
- Click Close.
- Wait until the Job finishes OK.
- Under Administration, Double-Click Thresholds.
- Select TrainingThreshold from the Select Threshold drop-down list.
- Check the value. At this moment, it should be
1. What happened?- The Job ran and created a file under the
MSGINfolder. The file sent the$THRESHOLD:SET,TrainingThreshold,+1Event using theocadmOpCon account and its Event password (opconxps). - OpCon received the Event and processed it. It updated the value of the Threshold:
0 + 1 = 1
- The Job ran and created a file under the
- Close the Thresholds tab.
- Go back to one of your Operations Views.
- Right-Click the Threshold External Event Job> Maintenance> Edit Daily Job.
- Change the Command Line to this:
“C:\scripts\ExerciseThreshold.cmd” -1 - Click the Save button in the Daily Job toolbar (Do not save the Job to the Master).
- Close the Job Daily (Threshold External Event Job) tab.
- Right-Click the Job and select Restart.
- Wait until the Job finishes OK.
- Under Administration, Double-Click Thresholds.
- Select TrainingThreshold from the Select Threshold drop-down list.
- Check the value. At this moment, it should be back to
0. What happened?- The Job ran and created a file under the
MSGINfolder. The file sent the$THRESHOLD:SET,TrainingThreshold,-1Event using theocadmOpCon account and its Event password (opconxps). - OpCon received the Event and processed it. It updated the value of the Threshold:
1 - 1 = 0
- The Job ran and created a file under the
- Close the Thresholds tab.